from django.db import models

# Create your models here.
class TestBanner(models.Model):
    title = models.CharField(max_length=20, verbose_name='标题')
    imgurl = models.CharField(max_length=100, verbose_name='图片路径')
    isuse = models.BooleanField(default=True, verbose_name='是否启用')
    isdel = models.BooleanField(default=False, verbose_name='是否删除')
    sort = models.IntegerField(default=0, verbose_name='排序')
    addtime = models.DateTimeField(auto_now_add=True, verbose_name='添加时间')
    class Meta:
        db_table="testbanner"
    def __str__(self):
        return self.title

class Book(models.Model):
    name = models.CharField(max_length=20, verbose_name='书名')
    author = models.CharField(max_length=20, verbose_name='作者')
    price = models.DecimalField(max_digits=5, decimal_places=2, verbose_name='价格')
    isuse = models.BooleanField(default=True, verbose_name='是否启用')
    class Meta:
        db_table="testbook"
    def __str__(self):
        return self.name